package com.mxchip.livestar.duobeiyun.pass;

import android.content.Context;

import com.mxchip.livestar.R;

import java.util.HashMap;
import java.util.Map;

public class NetMap {
    private Map<Integer, String> txQuality = new HashMap<>();
    private Map<Integer, String> rxQuality = new HashMap<>();

    public NetMap(Context context) {
        txQuality.put(0, context.getString(R.string.unknown_quality));
        txQuality.put(1, context.getString(R.string.excellent_quality));
        txQuality.put(2, context.getString(R.string.good_quality));
        txQuality.put(3, context.getString(R.string.can_generally_communicate));
        txQuality.put(4, context.getString(R.string.not_smooth));
        txQuality.put(5, context.getString(R.string.basically_unable_communicate));
        txQuality.put(6, context.getString(R.string.totally_unable_communicate));
        txQuality.put(7, context.getString(R.string.not_checkout_net_downlink));
        txQuality.put(8, context.getString(R.string.detecting_network_quality));


        rxQuality.put(0, context.getString(R.string.unknown_quality));
        rxQuality.put(1, context.getString(R.string.excellent_quality));
        rxQuality.put(2, context.getString(R.string.good_quality));
        rxQuality.put(3, context.getString(R.string.can_generally_communicate));
        rxQuality.put(4, context.getString(R.string.not_smooth));
        rxQuality.put(5, context.getString(R.string.basically_unable_communicate));
        rxQuality.put(6, context.getString(R.string.totally_unable_communicate));
        rxQuality.put(7, context.getString(R.string.not_checkout_net_downlink));
        rxQuality.put(8, context.getString(R.string.detecting_network_quality));
    }

    /*
    QUALITY_UNKNOWN(0)：质量未知
     QUALITY_EXCELLENT(1)：质量极好
     QUALITY_GOOD(2)：用户主观感觉和极好差不多，但码率可能略低于极好
     QUALITY_POOR(3)：用户主观感受有瑕疵但不影响沟通
     QUALITY_BAD(4)：勉强能沟通但不顺畅
     QUALITY_VBAD(5)：网络质量非常差，基本不能沟通
     QUALITY_DOWN(6)：网络连接断开，完全无法沟通
     QUALITY_UNSUPPORTED(7)：没有检测到网络上行
     QUALITY_DETECTING(8)：SDK 正在探测网络质量
     */

    public String getTxQuality(int txInt) {
        return txQuality.get(txInt);
    }

    public String getRxQuality(int rxInt) {
        return rxQuality.get(rxInt);
    }

}
